Skip to content

fix: Study by card state or tag dropdown menu is prone to overflow#18954

Merged
mikehardy merged 1 commit intoankidroid:mainfrom
snowtimeglass:fix-custom-study-dialog-spiner-item-overflows
Jul 24, 2025
Merged

fix: Study by card state or tag dropdown menu is prone to overflow#18954
mikehardy merged 1 commit intoankidroid:mainfrom
snowtimeglass:fix-custom-study-dialog-spiner-item-overflows

Conversation

@snowtimeglass
Copy link
Contributor

Purpose / Description

Some labels in Study by card state or tag dropdown menu labels are relatively long, so they are prone to overflow on a single line.
image

This PR aims to resolve the issue.

Fixes

Approach

Use the existing multiline_spinner_item.xml instead of simple_spinner_item for layout

How Has This Been Tested?

Checked on a physical device (Android 11)

Before After
image image
image(In German) image
image(In Spanish) image

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!!

There was a ~16dp bottom margin which was removed by this change, it would look better if this were retained.


Could you also provide a before/after image of the selected item (when the spinner isn't open), as you've also modified how this is displayed.

I suspect the selected item should be truncated, but implementer's choice here.

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Jul 24, 2025
@snowtimeglass
Copy link
Contributor Author

snowtimeglass commented Jul 24, 2025

There was a ~16dp bottom margin which was removed by this change, it would look better if this were retained.

I haven't find out how to directly adjust the bottom margin in this case, but was planning to submit another PR (after the current PR for multiple-lines would be accepted) that would improve the margins (paddings) between the items. That commit would also improve the bottom margin to some extent:

Before current commit Current commit Planned further commit
image image image
image image image

@snowtimeglass
Copy link
Contributor Author

snowtimeglass commented Jul 24, 2025

Could you also provide a before/after image of the selected item (when the spinner isn't open), as you've also modified how this is displayed.
I suspect the selected item should be truncated, but implementer's choice here.

Thank you for pointing it out. I haven't notice the change how the selected item is shown. I'd also prefer the truncated single-line style for the selected item.

Current commit Before current commit / Planned further commit
image image

@david-allison david-allison force-pushed the fix-custom-study-dialog-spiner-item-overflows branch 2 times, most recently from f98b5ea to 1ab54ba Compare July 24, 2025 11:01
@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author labels Jul 24, 2025
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this up. Before & after

Screenshot 2025-07-24 at 11 56 46 Screenshot 2025-07-24 at 12 00 45

@david-allison david-allison force-pushed the fix-custom-study-dialog-spiner-item-overflows branch from 1ab54ba to 29397a1 Compare July 24, 2025 11:06
`minHeight` is no longer enforced, so use `paddingVertical`
if the height is over `minHeight`

14dp: by visual inspection, likely only correct for default
 text sizes

Fixes: 18953
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@mikehardy mikehardy added this pull request to the merge queue Jul 24, 2025
@mikehardy mikehardy added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge Queued for Cherry Pick to Stable Branch labels Jul 24, 2025
Merged via the queue into ankidroid:main with commit 54856f3 Jul 24, 2025
10 checks passed
@github-actions github-actions bot added this to the 2.22 release milestone Jul 24, 2025
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jul 24, 2025
@snowtimeglass snowtimeglass deleted the fix-custom-study-dialog-spiner-item-overflows branch July 30, 2025 01:31
@mikehardy mikehardy modified the milestones: 2.22 release, 2.23 release Jul 30, 2025
@david-allison
Copy link
Member

Hi there @snowtimeglass! This is the OpenCollective Notice for PRs merged from 2025-07-01 through 2025-07-31

If you are interested in compensation for this work, the process with details is here: https://github.com/ankidroid/Anki-Android/wiki/OpenCollective-Payment-Process#how-to-get-paid

We only post one comment per person per month to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged for this month

Please understand that our monthly budget is never guaranteed to cover all claims - the cap on payments-per-person may be lower, but we try to make our process as fair and transparent as possible, we just need your understanding.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Study by card state or tag dropdown menu is prone to overflow

3 participants